---
title: Financial Datasets API
---

**FinancialDatasetsTools** provide a comprehensive API for retrieving and analyzing diverse financial datasets, including stock prices, financial statements, company information, SEC filings, and cryptocurrency data from multiple providers.

## Prerequisites

The toolkit requires a Financial Datasets API key that can be obtained by creating an account at [financialdatasets.ai](https://financialdatasets.ai).

```bash
pip install agno
```

Set your API key as an environment variable:

```bash
export FINANCIAL_DATASETS_API_KEY=your_api_key_here
```

## Example

Basic usage of the Financial Datasets toolkit:

```python
from agno.agent import Agent
from agno.tools.financial_datasets import FinancialDatasetsTools

agent = Agent(
    name="Financial Data Agent",
    tools=[FinancialDatasetsTools()],
    description="You are a financial data specialist that helps analyze financial information for stocks and cryptocurrencies.",
    instructions=[
        "When given a financial query:",
        "1. Use appropriate Financial Datasets methods based on the query type",
        "2. Format financial data clearly and highlight key metrics",
        "3. For financial statements, compare important metrics with previous periods when relevant",
        "4. Calculate growth rates and trends when appropriate",
        "5. Handle errors gracefully and provide meaningful feedback",
    ],
    markdown=True,
    )

# Get the most recent income statement for Apple
agent.print_response("Get the most recent income statement for AAPL and highlight key metrics")
```

For more examples, see the [Financial Datasets Examples](/examples/concepts/tools/others/financial_datasets).

## Toolkit Params

| Parameter | Type            | Default | Description                                                                             |
| --------- | --------------- | ------- | --------------------------------------------------------------------------------------- | --- |
| `api_key` | `Optional[str]` | `None`  | Optional API key. If not provided, uses FINANCIAL_DATASETS_API_KEY environment variable |     |

## Toolkit Functions

| Function                      | Description                                                                                                     |
| ----------------------------- | --------------------------------------------------------------------------------------------------------------- |
| `get_income_statements`       | Get income statements for a company with options for annual, quarterly, or trailing twelve months (ttm) periods |
| `get_balance_sheets`          | Get balance sheets for a company with period options                                                            |
| `get_cash_flow_statements`    | Get cash flow statements for a company                                                                          |
| `get_company_info`            | Get company information including business description, sector, and industry                                    |
| `get_crypto_prices`           | Get cryptocurrency prices with configurable time intervals                                                      |
| `get_earnings`                | Get earnings reports with EPS estimates, actuals, and revenue data                                              |
| `get_financial_metrics`       | Get key financial metrics and ratios for a company                                                              |
| `get_insider_trades`          | Get data on insider buying and selling activity                                                                 |
| `get_institutional_ownership` | Get information about institutional investors and their positions                                               |
| `get_news`                    | Get market news, optionally filtered by company                                                                 |
| `get_stock_prices`            | Get historical stock prices with configurable time intervals                                                    |
| `search_tickers`              | Search for stock tickers based on a query string                                                                |
| `get_sec_filings`             | Get SEC filings with optional filtering by form type (10-K, 10-Q, etc.)                                         |
| `get_segmented_financials`    | Get segmented financial data by product category and geographic region                                          |

You can use `include_tools` or `exclude_tools` to modify the list of tools the agent has access to. Learn more about [selecting tools](/concepts/tools/selecting-tools).

## Rate Limits and Usage

The Financial Datasets API may have usage limits based on your subscription tier. Please refer to their documentation for specific rate limit information.

## Developer Resources

- View [Tools](https://github.com/agno-agi/agno/blob/main/libs/agno/agno/tools/financial_datasets.py)
- View [Cookbook](https://github.com/agno-agi/agno/tree/main/cookbook/tools/financial_datasets_tools.py)
